import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class code2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int target = in.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }

        int left = 0;
        int right = 0;
        int sum = 0;
        int L = -1, R = -1;
        int rmin = n + 2;
        while (right < n) {
            //进
            sum += nums[right];
            //判断
            while (sum >= target) {
                //更新结果
                if (right - left + 1 < rmin) {
                    rmin = right - left + 1;
                    R = right+1;
                    L = left+1;
                }
                //出
                sum -= nums[left++];
            }
            right++;
        }
        System.out.print(L + " " + R);
    }
}